package com.ye.feign;

import com.ye.domain.Comments;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("mould-db")
public interface CommentsFeign {

    @GetMapping("/getAllComments")
    public List<Comments> getAllCommentsByMusicId(@RequestParam("musicId") Integer musicId);

    //    查询指定musicId下的所有首级评论
    @GetMapping("/getFirsts")
    public List<Comments> getFirsts(@RequestParam("musicId") Long musicId);

    //    查询当前音乐下的所有首级评论各自对应的二级评论
    @GetMapping("/getChilds")
    public List<Comments> getChilds(@RequestParam("commentsId") Long commentsId);

    //    添加一条评论
    @GetMapping("/insertFirstComment")
    public void firstComment(@RequestParam("musicId") Long musicId,@RequestParam("content") String content,@RequestParam("userId") Long userId);

    //    添加一条回复
    @GetMapping("/reply")
    public void reply(@RequestParam("musicId") Long musicId,@RequestParam("parentId") Long parentId,@RequestParam("content") String content,@RequestParam("userId") Long userId);

}
